package it.giuseppetrisciuoglio.lyrics.processor;

import it.giuseppetrisciuoglio.lyrics.persistence.entity.Errore;
import it.giuseppetrisciuoglio.lyrics.persistence.repository.ErroreRepository;

import org.apache.camel.Body;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ErrorProcessor {

	@Autowired
	private ErroreRepository erroreRepository;
	
	private final transient Logger log = LoggerFactory.getLogger(getClass());
	
	public void process(@Body Errore errore){
		log.debug("process(): errore={}", errore);
		erroreRepository.save(errore);
	}
	
}
